using AElf.Database;
using AElf.Kernel.Infrastructure;
using AElf.Modularity;
using AElf.TestBase;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;

namespace AElf.Kernel;

[DependsOn(
    typeof(TestBaseAElfModule), typeof(CoreKernelAElfModule))]
public class TestBaseKernelAElfModule : AElfModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        var services = context.Services;

        services.AddKeyValueDbContext<BlockchainKeyValueDbContext>(o => o.UseInMemoryDatabase());
        services.AddKeyValueDbContext<StateKeyValueDbContext>(o => o.UseInMemoryDatabase());

        services.AddSingleton<KernelTestHelper>();
    }
}